package com.wo.cloud.auth.controller;

import com.wo.cloud.auth.service.ValidateService;
import com.wo.cloud.auth.util.SmsConstant;
import com.wo.cloud.core.entity.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.Duration;

/**
 * @author liry
 * @version 1.0
 * @date Created on 2021/5/25 15:53
 * Description: 认证控制类
 */

@Slf4j
@RestController
@AllArgsConstructor
@RequestMapping("/auth")
@Api(tags = "认证管理")
public class AuthController {

    @Autowired
    private ValidateService validateService;


    /**
     * 验证码下发
     *
     * @param mobile 手机号码
     * @return Result
     */
//    @Log(value = "手机验证码下发")
    @ApiOperation(value = "手机验证码下发", notes = "手机验证码下发")
    @GetMapping("/sms-code")
    public Response<?> smsCode(String mobile) {
        return validateService.getSmsCode(mobile);
    }

}
